#include "LogicProtocol_CommHeader.h"
#include "LogicProtocol_CommPacket/LogicProtocol_CommPacket.h"
#include "LogicProtocol_QueryPacket/LogicProtocol_QueryPacket.h"
//////////////////////////////////////////////////////////////////////////
BOOL LogicProtocol_IsErrorOccur = FALSE;
DWORD LogicProtocol_dwErrorCode = 0;
//////////////////////////////////////////////////////////////////////////
CLogicProtocol_CommPacket m_CommProtocol;
CLogicProtocol_QueryPacket m_QueryProtocol;
//////////////////////////////////////////////////////////////////////////
//                       导出函数实现
//////////////////////////////////////////////////////////////////////////
extern "C" DWORD LogicProtocol_GetLastError(int *pInt_SysError)
{
    if (NULL != pInt_SysError)
    {
        *pInt_SysError = errno;
    }
    return LogicProtocol_dwErrorCode;
}
/*********************************************************************************
*                        公用协议打包服务导出函数定义                                *
*********************************************************************************/
extern "C" BOOL LogicProtocol_CommPacket_Hdr(NETENGINE_PROTOCOLHDR *pSt_ProtocolHdr, TCHAR *ptszMsgBuffer, int *pInt_Len)
{
    return m_CommProtocol.LogicProtocol_CommPacket_Hdr(pSt_ProtocolHdr,ptszMsgBuffer,pInt_Len);
}
extern "C" BOOL LogicProtocol_CommPacket_HdrJson(NETENGINE_PROTOCOLHDR *pSt_ProtocolHdr,TCHAR *ptszMsgBuffer,int *pInt_Len,int nMsgCode,LPCTSTR lpszMsgJson)
{
    return m_CommProtocol.LogicProtocol_CommPacket_HdrJson(pSt_ProtocolHdr,ptszMsgBuffer,pInt_Len,nMsgCode,lpszMsgJson);
}
/*********************************************************************************
*                        查询协议打包服务导出函数定义                                *
*********************************************************************************/
extern "C" BOOL LogicProtocol_QueryPacket_FileReq(LPCTSTR lpszMsgJson,TCHAR *ptszSQLName)
{
    return m_QueryProtocol.LogicProtocol_QueryPacket_FileReq(lpszMsgJson,ptszSQLName);
}
extern "C" BOOL LogicProtocol_QueryPacket_FileRep(NETENGINE_PROTOCOLHDR *pSt_ProtocolHdr,list<LOGICSQL_SOFTLIST> *pSt_SoftList,TCHAR *ptszMsgBuffer,int *pInt_Len)
{
    return m_QueryProtocol.LogicProtocol_QueryPacket_FileRep(pSt_ProtocolHdr,pSt_SoftList,ptszMsgBuffer,pInt_Len);
}
